/*
	Decoder.h - Library for 

	Created by the LSI Capstone team at UMBC on March 11, 2014


 */


#ifndef Decoder_h
#define Decoder_h

#include <Arduino.h>

class Decoder {
	public:
		Decoder(int oPin_CD, int oPin_WR, int oPin_RD, int oPin_FLG1, 
			int oPin_FLG2);
		unsigned long getCount();

	private:
		void initializeDecoder();
		void write(unsigned long Data);
		unsigned long read();
		unsigned char getFlags();
		unsigned char inp(int Addr);
		unsigned char outp(int Addr, unsigned char Data);
		unsigned long lrotr(unsigned long Data, unsigned char bits);

		// Decoder Control Pins on uC
		int oPin_CD;
		int oPin_WR;
		int oPin_RD;
		int oPin_FLG1;
		int oPin_FLG2;
};

#endif
